#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "InvocationAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// SendObjectAction
/// A SendObjectAction is an InvocationAction that transmits an input object to the
/// target object, which is handled as a request message by the target object. The
/// requestor continues execution immediately after the object is sent out and
/// cannot receive reply values.
/// </summary>
class UMLMODEL_EXPORT SendObjectAction : public InvocationAction {

public: // Constructors and destructors
    explicit SendObjectAction(const QString& umlType="uml::SendObjectAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// request getter
    /// The request object, which is transmitted to the target object. The object may be
    /// copied in transmission, so identity might not be preserved.
    /// </summary>
    shared_ptr<InputPin> request() const;

    /// <summary>
    /// request setter
    /// The request object, which is transmitted to the target object. The object may be
    /// copied in transmission, so identity might not be preserved.
    /// </summary>
    void setRequest(shared_ptr<InputPin> value);

    /// <summary>
    /// target getter
    /// The target object to which the object is sent.
    /// </summary>
    shared_ptr<InputPin> target() const;

    /// <summary>
    /// target setter
    /// The target object to which the object is sent.
    /// </summary>
    void setTarget(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// request
    /// The request object, which is transmitted to the target object. The object may be
    /// copied in transmission, so identity might not be preserved.
    /// </summary>
    shared_ptr<InputPin> request_;

    /// <summary>
    /// target
    /// The target object to which the object is sent.
    /// </summary>
    shared_ptr<InputPin> target_;

};

} // namespace uml
